﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using LayeredSkin.Controls;
using LayeredSkin.DirectUI;
using Dandan.Menu;
using QQ.Controls;
using Dandan.Properties;
using System.Drawing.Drawing2D;
using Newtonsoft.Json;
using System.Drawing.Printing;
using Dandan.Tool;

namespace Dandan
{
    public partial class AddCommodityInfo : LayeredBaseForm
    {
        #region 变量

        private ScanerHook listener = new ScanerHook();

        /// <summary>
        /// 全局DuiBaseControl控件申明（重复利用）
        /// </summary>
        private DuiBaseControl _baseControl;

        /// <summary>
        /// 选中的好友项ID(为选中为-1)
        /// </summary>
        public int ItemsIndex = -1;

        /// <summary>
        /// 选中的好友项ID(为选中为-1)
        /// </summary>
        public int GroupItemsIndex = -1;

        private Font _font = new Font("微软雅黑", 9.3F, FontStyle.Regular, GraphicsUnit.Point,
            ((byte)(134)));
        /// <summary>
        /// 是否已读取完列表
        /// </summary>
        public bool IsLoadedItems = false;

        //public static List<FrmChat> FrmChatsList = new List<FrmChat>();

        public FrmMainMenu QFrmMainMenu = null;
        //public FrmSetting QFrmSetting = null;
        #endregion

        #region 构造函数

        public AddCommodityInfo()
        {
            InitializeComponent();
            Control.CheckForIllegalCrossThreadCalls = false;
            layeredDragBar1.ForeColor =
                layeredDragBar2.ForeColor =
                    layeredDragBar3.ForeColor = layeredDragBar4.ForeColor = Color.FromArgb(255, Color.White);
            
        }

        #endregion

        

        private void PrintToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void FromMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            listener.Stop();
        }

        private void AddCommodityInfo_Load(object sender, EventArgs e)
        {
            AddGroupBox();
        }

        //添加控件  
        public void AddGroupBox()
        {
            string name = "gbox";
            for (int i = 0; i < 3; i++)
            {
                GroupBox gbox = new GroupBox();
                gbox.Name = name + i;
                gbox.Text = name + i;
                gbox.Width = 300;
                gbox.Height = 100;
                gbox.Location = new Point(32, 20 + i * 150);
                this.panel5.Controls.Add(gbox);
                //调用添加文本控件的方法  
                AddTxt(gbox);
            }
        }
        //添加文本控件  
        public void AddTxt(GroupBox gb)
        {
            string name = "txt";
            for (int i = 0; i < 3; i++)
            {
                TextBox txt = new TextBox();
                txt.Name = gb.Name + name + i;
                txt.Text = gb.Name + "|" + name + i;
                txt.Location = new Point(12, 15 + i * 30);
                gb.Controls.Add(txt);
            }
        }

        private void BtnClose_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
